{% extends 'management.html' %}
{% load i18n %}


{% block content %}
<div id="detail">
  <h4>
    <a href="/admin/add/">{% trans 'Create new' %}</a>
  </h4>    

  {% for note in data %}
     <div class="post">
        <h1><a href="/main/note/?id={{note.key.id}}">
           {{note.title}}
           </a>
        </h1>
        <h5>
          {{note.createTime|date:"Y-m-d H:i:s"}}&nbsp;&nbsp;
          {% trans "Category" %}:<a href="/?category={{note.jumCategory.key.id}}">{{note.jumCategory.name}}</a>&nbsp;&nbsp;
          {% trans "Comments" %}:{{note.notecomment_set.count}}&nbsp;&nbsp;
          {% trans "Reference" %}:{{note.trackback_set.count}}&nbsp;&nbsp;
          {% trans "Tags" %}:
            {% for notetag in note.notetag_set %}
              {% if not forloop.first %}
              ,
              {% endif %}
            <a href="/main/notes/?tag={{notetag.tag.key.id}}">{{notetag.tag.name}}</a>
            {% endfor %}
          &nbsp;&nbsp;{% trans 'Location'%}:{{note.locations}}
        </h5>
        <h4>
              <a href="/admin/editnote/?id={{note.key.id}}">{% trans 'Edit' %}</a>
              &nbsp;&nbsp;
              <a href="/admin/deletenote/?id={{note.key.id}}"  onClick="return confirm('{% trans "Are you sure?" %}')">{% trans 'Delete' %}</a>
        </h4>
      </div>
  {% endfor %}
  </div>
{% endblock content %}